<?php /* Smarty version 2.3.0, created on 2011-08-18 00:18:51
         compiled from Default/edit_survey_new_answer.tpl */ ?>

<script>
function ver_barra(image_num)
{    
    //alert(document.getElementById("image_"+image_num).value);
	var barra = document.getElementById("image_"+image_num).value;
	window.open('<?php echo $this->_tpl_vars['conf']['html']; ?>
/ver_barra.php?nameBarra='+barra,'ventanita','toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=450,height=400,left=30,top=30');
}
</script>

<?php echo '
<script>
function cambiar(esto)
{
	vista=document.getElementById(esto).style.display;
	if (vista==\'none\')
		vista=\'block\';
	else
		vista=\'none\';

	document.getElementById(esto).style.display = vista;
}

</script>
'; ?>

<table     align="center" style="BORDER-RIGHT:#999 1px solid; border-bottom:#999 1px solid; border-left:#999 1px solid; 
        border-top:#999 1px solid;" width="952" border="0" cellpadding="0" cellspacing="0">

  <!--DWLayoutTable-->
  <tr>
    <td height="19" colspan="2" valign="top"    ><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
         <td width="20" height="19" valign="top" bgcolor="#333333" style="border-bottom:#999999 2px solid;"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td width="644" valign="middle" bgcolor="#333333" style="border-bottom:#999999 2px solid;" class="style2">Agregar Respuesta </td>
        <td width="268" valign="middle" align="right" bgcolor="#333333" style="border-bottom:#999999 2px solid;" class="style2"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td width="19" valign="top" bgcolor="#333333" style="border-bottom:#999999 2px solid;"><!--DWLayoutEmptyCell-->&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td   width="15" height="212" valign="top"    ><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td  width="935" valign="top"    ><table   width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
	
     <tr>
	 <td width="935"  valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
	   <!--DWLayoutTable-->
	   <tr>
	     <td width="935"  align="center" valign="bottom">
		  
            <?php if (isset($this->_sections["success"])) unset($this->_sections["success"]);
$this->_sections["success"]['name'] = "success";
$this->_sections["success"]['loop'] = is_array("1") ? count("1") : max(0, (int)"1");
$this->_sections["success"]['show'] = (bool)$this->_tpl_vars['success'];
$this->_sections["success"]['max'] = $this->_sections["success"]['loop'];
$this->_sections["success"]['step'] = 1;
$this->_sections["success"]['start'] = $this->_sections["success"]['step'] > 0 ? 0 : $this->_sections["success"]['loop']-1;
if ($this->_sections["success"]['show']) {
    $this->_sections["success"]['total'] = $this->_sections["success"]['loop'];
    if ($this->_sections["success"]['total'] == 0)
        $this->_sections["success"]['show'] = false;
} else
    $this->_sections["success"]['total'] = 0;
if ($this->_sections["success"]['show']):

            for ($this->_sections["success"]['index'] = $this->_sections["success"]['start'], $this->_sections["success"]['iteration'] = 1;
                 $this->_sections["success"]['iteration'] <= $this->_sections["success"]['total'];
                 $this->_sections["success"]['index'] += $this->_sections["success"]['step'], $this->_sections["success"]['iteration']++):
$this->_sections["success"]['rownum'] = $this->_sections["success"]['iteration'];
$this->_sections["success"]['index_prev'] = $this->_sections["success"]['index'] - $this->_sections["success"]['step'];
$this->_sections["success"]['index_next'] = $this->_sections["success"]['index'] + $this->_sections["success"]['step'];
$this->_sections["success"]['first']      = ($this->_sections["success"]['iteration'] == 1);
$this->_sections["success"]['last']       = ($this->_sections["success"]['iteration'] == $this->_sections["success"]['total']);
?>
              <div class="message">New answer type successfully added.</div>
            <?php endfor; endif; ?>
          

      <?php if (isset($this->_sections["error"])) unset($this->_sections["error"]);
$this->_sections["error"]['name'] = "error";
$this->_sections["error"]['loop'] = is_array("1") ? count("1") : max(0, (int)"1");
$this->_sections["error"]['show'] = (bool)$this->_tpl_vars['show']['error'];
$this->_sections["error"]['max'] = $this->_sections["error"]['loop'];
$this->_sections["error"]['step'] = 1;
$this->_sections["error"]['start'] = $this->_sections["error"]['step'] > 0 ? 0 : $this->_sections["error"]['loop']-1;
if ($this->_sections["error"]['show']) {
    $this->_sections["error"]['total'] = $this->_sections["error"]['loop'];
    if ($this->_sections["error"]['total'] == 0)
        $this->_sections["error"]['show'] = false;
} else
    $this->_sections["error"]['total'] = 0;
if ($this->_sections["error"]['show']):

            for ($this->_sections["error"]['index'] = $this->_sections["error"]['start'], $this->_sections["error"]['iteration'] = 1;
                 $this->_sections["error"]['iteration'] <= $this->_sections["error"]['total'];
                 $this->_sections["error"]['index'] += $this->_sections["error"]['step'], $this->_sections["error"]['iteration']++):
$this->_sections["error"]['rownum'] = $this->_sections["error"]['iteration'];
$this->_sections["error"]['index_prev'] = $this->_sections["error"]['index'] - $this->_sections["error"]['step'];
$this->_sections["error"]['index_next'] = $this->_sections["error"]['index'] + $this->_sections["error"]['step'];
$this->_sections["error"]['first']      = ($this->_sections["error"]['iteration'] == 1);
$this->_sections["error"]['last']       = ($this->_sections["error"]['iteration'] == $this->_sections["error"]['total']);
?>
        <div class="error"><?php echo $this->_tpl_vars['show']['error']; ?>
</div>
      <?php endfor; endif; ?>
		 </td>
	       </tr>
	   </table></td>
	 </tr>
	  <form method="POST" action="<?php echo $this->_tpl_vars['conf']['html']; ?>
/new_answer_type.php" name="qform" enctype="multipart/form-data">
        <input type="hidden" name="cbas" value="<?php echo $this->_tpl_vars['cbas']; ?>
">
        <input type="hidden" name="sid" value="<?php echo $this->_tpl_vars['input']['sid']; ?>
">
		<input type="hidden" name="qid" value="<?php echo $this->_tpl_vars['data']['qid']; ?>
">

      <tr>
        <td height="78" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="464" height="25">&nbsp;</td>
              <td width="471">&nbsp;</td>
          </tr>
          <!--DWLayoutTable-->
          <tr>
            <td height="33" valign="top">
			<table width="100%"  border="0" cellpadding="0" cellspacing="0">
			
              <!--DWLayoutTable-->
              <tr>
                <td width="464" height="33" valign="top"><strong><a href="javascript:cambiar('tres')">+</a> Tipo
                  de Respuesta</strong>
                  <select name="type" size="1">
                      <option value="MS" <?php echo $this->_tpl_vars['selected']['MS']; ?>
>MS - Multiples Opciones, Una Respuesta</option>
                      <option value="MM" <?php echo $this->_tpl_vars['selected']['MM']; ?>
>MM - Multiples Opciones, Multiples Respuestas</option>
					  <!--  <option value="T" <?php echo $this->_tpl_vars['selected']['T']; ?>
>T - Textbox, large</option>
					  <option value="S" <?php echo $this->_tpl_vars['selected']['S']; ?>
>S - Textbox, small</option>-->
					  <!-- <option value="NUM" <?php echo $this->_tpl_vars['selected']['NUM']; ?>
>NUM - Numeric Answer</option>
					  <option value="DATE" <?php echo $this->_tpl_vars['selected']['DATE']; ?>
>DATE - Date/Time Answer</option> -->
					  <!--  <option value="N" <?php echo $this->_tpl_vars['selected']['N']; ?>
>N - No Answer Values</option>-->
                   </select>
				 </td>
                      </tr>
              <tr>
                <td valign="top">
                  <div id="tres" style="display: none;">
                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                      <!--DWLayoutTable-->
                      <tr>
                        <td width="464" height="120" valign="top">
                          * MS = Multiples opciones, una sola respuesta a escoger.<br />
                          * MM = Multiples opciones, mas de una respuesta a escoger<br /><br />
                          Answer Values (MS and MM Answer Types only) 
                          You must supply a list of possible answers if you selected MS or MM for an Answer Type. 
                          List one answer per text box in the boxes below. Use the button at the bottom of the boxes to add more boxes for more answers. The order you list the answers here is the order they will be presented in the surveys. 
                          You can optionally assign a numeric value to each answer value that you provide, also. This numeric value can then be used when exporting the results to a CSV file for processing by other analysis programs.	 </td>
                              </tr>
                      </table>
                        </div>					</td>
                      </tr>
              </table></td>
                  <td>&nbsp;</td>
                </tr>
          <tr>
            <td height="20"></td>
                  <td></td>
                </tr>
   
        </table></td>
          </tr>
      
      <tr>
        <td height="106" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          
          <tr>
            <td width="921" height="53"  valign="top"><table class="centro"  border="0" cellpadding="0" cellspacing="0">
              <!--DWLayoutTable-->
              <tr>
                <td width="25" height="26" valign="bottom" ><strong>Num</strong></td>
                        <td width="335" valign="bottom"  ><strong>Valores de Respuesta (Visualizar)</strong></td>
                        <td width="65" valign="bottom" ><strong>Valores Numericos</strong></td>
                        <td width="159" valign="bottom"   ><strong>Imagen de Grafico <br />
de Barra </strong></td>
                        <td width="73" valign="bottom"  ><strong>Ver <br />
Barra </strong></td>
                        <td width="90" valign="bottom"  ><strong>Puntaje</strong></td>
                        <td width="174" align="center" valign="top"  ><strong>Imagen de Respuesta. max 20KB<br />
						Size 120x50 <br />
                       Solo tipo .gif .jpg .jpeg .png </strong></td>
                      </tr>
              <?php if (isset($this->_sections["i"])) unset($this->_sections["i"]);
$this->_sections["i"]['name'] = "i";
$this->_sections["i"]['loop'] = is_array($this->_tpl_vars['input']['num_answers']) ? count($this->_tpl_vars['input']['num_answers']) : max(0, (int)$this->_tpl_vars['input']['num_answers']);
$this->_sections["i"]['show'] = (bool)"TRUE";
$this->_sections["i"]['max'] = $this->_sections["i"]['loop'];
$this->_sections["i"]['step'] = 1;
$this->_sections["i"]['start'] = $this->_sections["i"]['step'] > 0 ? 0 : $this->_sections["i"]['loop']-1;
if ($this->_sections["i"]['show']) {
    $this->_sections["i"]['total'] = $this->_sections["i"]['loop'];
    if ($this->_sections["i"]['total'] == 0)
        $this->_sections["i"]['show'] = false;
} else
    $this->_sections["i"]['total'] = 0;
if ($this->_sections["i"]['show']):

            for ($this->_sections["i"]['index'] = $this->_sections["i"]['start'], $this->_sections["i"]['iteration'] = 1;
                 $this->_sections["i"]['iteration'] <= $this->_sections["i"]['total'];
                 $this->_sections["i"]['index'] += $this->_sections["i"]['step'], $this->_sections["i"]['iteration']++):
$this->_sections["i"]['rownum'] = $this->_sections["i"]['iteration'];
$this->_sections["i"]['index_prev'] = $this->_sections["i"]['index'] - $this->_sections["i"]['step'];
$this->_sections["i"]['index_next'] = $this->_sections["i"]['index'] + $this->_sections["i"]['step'];
$this->_sections["i"]['first']      = ($this->_sections["i"]['iteration'] == 1);
$this->_sections["i"]['last']       = ($this->_sections["i"]['iteration'] == $this->_sections["i"]['total']);
?>
              <tr>
                <td height="27" valign="middle"  ><?php echo $this->_sections['i']['iteration']; ?>
.</td>
                      <td valign="top"  ><input type="text" name="value[]" value="<?php echo $this->_tpl_vars['input']['value'][$this->_sections['i']['index']]; ?>
" size="40" maxlength="255" /></td>
                      <td valign="top"  ><input type="text" name="numeric_value[]" value="<?php echo $this->_tpl_vars['input']['numeric_value'][$this->_sections['i']['index']]; ?>
" size="5" /></td>
                      <td valign="top"  ><select  name="image[]" id="image_<?php echo $this->_sections['i']['iteration']; ?>
"  size="1" >
                        
                 <?php if (isset($this->_sections["image"])) unset($this->_sections["image"]);
$this->_sections["image"]['name'] = "image";
$this->_sections["image"]['loop'] = is_array($this->_tpl_vars['input']['allowable_images']) ? count($this->_tpl_vars['input']['allowable_images']) : max(0, (int)$this->_tpl_vars['input']['allowable_images']);
$this->_sections["image"]['show'] = (bool)"TRUE";
$this->_sections["image"]['max'] = $this->_sections["image"]['loop'];
$this->_sections["image"]['step'] = 1;
$this->_sections["image"]['start'] = $this->_sections["image"]['step'] > 0 ? 0 : $this->_sections["image"]['loop']-1;
if ($this->_sections["image"]['show']) {
    $this->_sections["image"]['total'] = $this->_sections["image"]['loop'];
    if ($this->_sections["image"]['total'] == 0)
        $this->_sections["image"]['show'] = false;
} else
    $this->_sections["image"]['total'] = 0;
if ($this->_sections["image"]['show']):

            for ($this->_sections["image"]['index'] = $this->_sections["image"]['start'], $this->_sections["image"]['iteration'] = 1;
                 $this->_sections["image"]['iteration'] <= $this->_sections["image"]['total'];
                 $this->_sections["image"]['index'] += $this->_sections["image"]['step'], $this->_sections["image"]['iteration']++):
$this->_sections["image"]['rownum'] = $this->_sections["image"]['iteration'];
$this->_sections["image"]['index_prev'] = $this->_sections["image"]['index'] - $this->_sections["image"]['step'];
$this->_sections["image"]['index_next'] = $this->_sections["image"]['index'] + $this->_sections["image"]['step'];
$this->_sections["image"]['first']      = ($this->_sections["image"]['iteration'] == 1);
$this->_sections["image"]['last']       = ($this->_sections["image"]['iteration'] == $this->_sections["image"]['total']);
?>
                    
                        <option  value="<?php echo $this->_tpl_vars['input']['allowable_images'][$this->_sections['image']['index']]; ?>
"<?php echo $this->_tpl_vars['selected']['image'][$this->_sections['i']['index']][$this->_sections['image']['index']]; ?>
><?php echo $this->_tpl_vars['input']['allowable_images'][$this->_sections['image']['index']]; ?>
</option>
                        
                 <?php endfor; endif; ?>
              
                      </select>
                      </td>
                      <td valign="top"  align="center" ><input type="button" name="verBarra" value="Ver" onclick="ver_barra(<?php echo $this->_sections['i']['iteration']; ?>
);" /></td>
                      <td valign="top"  ><input type="text" name="puntaje[]"  size="5" <?php if ($this->_tpl_vars['input']['tipo'] == 0): ?>readonly<?php endif; ?>></td>
                      <td valign="top"  ><input name="Imagen_Answer[]" type="file"  size="16"/></td>
                      </tr>
              <tr>
                <td height="0"></td>
                      <td></td>
                      <td></td>
                      <td></td>
                      <td></td>
                      <td></td>
                      <td></td>
                      </tr>
              
              <?php endfor; endif; ?>
            </table></td>
          <td width="14">&nbsp;</td>
            </tr>
          <tr>
            <td height="30"  valign="top">
			  <?php if (isset($this->_sections["add_answer"])) unset($this->_sections["add_answer"]);
$this->_sections["add_answer"]['name'] = "add_answer";
$this->_sections["add_answer"]['loop'] = is_array("1") ? count("1") : max(0, (int)"1");
$this->_sections["add_answer"]['show'] = (bool)$this->_tpl_vars['input']['show_add_answers'];
$this->_sections["add_answer"]['max'] = $this->_sections["add_answer"]['loop'];
$this->_sections["add_answer"]['step'] = 1;
$this->_sections["add_answer"]['start'] = $this->_sections["add_answer"]['step'] > 0 ? 0 : $this->_sections["add_answer"]['loop']-1;
if ($this->_sections["add_answer"]['show']) {
    $this->_sections["add_answer"]['total'] = $this->_sections["add_answer"]['loop'];
    if ($this->_sections["add_answer"]['total'] == 0)
        $this->_sections["add_answer"]['show'] = false;
} else
    $this->_sections["add_answer"]['total'] = 0;
if ($this->_sections["add_answer"]['show']):

            for ($this->_sections["add_answer"]['index'] = $this->_sections["add_answer"]['start'], $this->_sections["add_answer"]['iteration'] = 1;
                 $this->_sections["add_answer"]['iteration'] <= $this->_sections["add_answer"]['total'];
                 $this->_sections["add_answer"]['index'] += $this->_sections["add_answer"]['step'], $this->_sections["add_answer"]['iteration']++):
$this->_sections["add_answer"]['rownum'] = $this->_sections["add_answer"]['iteration'];
$this->_sections["add_answer"]['index_prev'] = $this->_sections["add_answer"]['index'] - $this->_sections["add_answer"]['step'];
$this->_sections["add_answer"]['index_next'] = $this->_sections["add_answer"]['index'] + $this->_sections["add_answer"]['step'];
$this->_sections["add_answer"]['first']      = ($this->_sections["add_answer"]['iteration'] == 1);
$this->_sections["add_answer"]['last']       = ($this->_sections["add_answer"]['iteration'] == $this->_sections["add_answer"]['total']);
?>
			  Agregar
              <select name="add_answer_num" size="1">
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="5">5</option>
                <option value="10">10</option>
                <option value="20">20</option>
                </select>
              campo mas para llenar Valores.
               <input type="submit" name="add_answers_submit" value="agregar">
			   <input type="hidden" name="num_answers" value="<?php echo $this->_tpl_vars['input']['num_answers']; ?>
">
			   <?php endfor; endif; ?>
			  </td>
                  <td>&nbsp;</td>
          </tr>
          <tr>
            <td height="27">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
		 

          </table></td>
          </tr>
      <tr>
        <td height="26" align="center" valign="top">
		<input type="submit" name="submit" value="Agregar Respuesta">
		</td>
          </tr>
	    </form>
      <tr>
        <td height="2"></td>
        </tr>
   
    </table></td>
  </tr>
  
</table>